home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 4 / BBS in a Box - Macintosh - Volume IV (January 1992) (BBS in a Box).iso / Files / Hyper / Ss-Sz / Stock INVESTOR.cpt / Stock INVESTOR / background_2888.txt < prev    next >
Encoding:
Text File  |  1988-10-19  |  6.4 KB  |  286 lines

  1. -- background: 2888 from stack: in
  2. -- bmap block id: 17284
  3. -- flags: 0000
  4. -- background id: 0
  5. -- name: Stock Background
  6.  
  7.  
  8. -- part 1 (field)
  9. -- low flags: 00
  10. -- high flags: 0001
  11. -- rect: left=32 top=34 right=50 bottom=488
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 0 / 0
  14. -- text alignment: 1
  15. -- font id: 3
  16. -- text size: 12
  17. -- style flags: 256
  18. -- line height: 16
  19. -- part name: Name
  20.  
  21.  
  22. -- part 2 (field)
  23. -- low flags: 00
  24. -- high flags: 0007
  25. -- rect: left=82 top=96 right=302 bottom=168
  26. -- title width / last selected line: 0
  27. -- icon id / first selected line: 0 / 0
  28. -- text alignment: 0
  29. -- font id: 3
  30. -- text size: 12
  31. -- style flags: 0
  32. -- line height: 16
  33. -- part name: Date
  34.  
  35.  
  36. -- part 3 (field)
  37. -- low flags: 00
  38. -- high flags: 0007
  39. -- rect: left=241 top=96 right=302 bottom=313
  40. -- title width / last selected line: 0
  41. -- icon id / first selected line: 0 / 0
  42. -- text alignment: 0
  43. -- font id: 3
  44. -- text size: 12
  45. -- style flags: 0
  46. -- line height: 16
  47. -- part name: Price
  48.  
  49.  
  50. -- part 4 (field)
  51. -- low flags: 00
  52. -- high flags: 0007
  53. -- rect: left=319 top=96 right=302 bottom=391
  54. -- title width / last selected line: 0
  55. -- icon id / first selected line: 0 / 0
  56. -- text alignment: 0
  57. -- font id: 3
  58. -- text size: 12
  59. -- style flags: 0
  60. -- line height: 16
  61. -- part name: Volume
  62.  
  63.  
  64. -- part 6 (button)
  65. -- low flags: 00
  66. -- high flags: 8003
  67. -- rect: left=397 top=262 right=284 bottom=481
  68. -- title width / last selected line: 0
  69. -- icon id / first selected line: 0 / 0
  70. -- text alignment: 1
  71. -- font id: 0
  72. -- text size: 12
  73. -- style flags: 0
  74. -- line height: 16
  75. -- part name: Menu
  76. ----- HyperTalk script -----
  77. on mouseUp
  78.   go card id 4680
  79. end mouseUp
  80.  
  81.  
  82.  
  83. -- part 7 (button)
  84. -- low flags: 00
  85. -- high flags: 8003
  86. -- rect: left=397 top=226 right=248 bottom=481
  87. -- title width / last selected line: 0
  88. -- icon id / first selected line: 0 / 0
  89. -- text alignment: 1
  90. -- font id: 0
  91. -- text size: 12
  92. -- style flags: 0
  93. -- line height: 16
  94. -- part name: Update
  95. ----- HyperTalk script -----
  96. on mouseUp
  97.   put empty into field "DCV"
  98.   get the number of lines in field "Date"
  99.   put it into NumLines
  100.   get line 1 of field "Price"
  101.   put it into x
  102.   get line 1 of field "Volume"
  103.   put it into y
  104.   put y into line 1 of field "DCV"
  105.   repeat with temp = 2 to NumLines
  106.     get line temp of field "Price"
  107.     put it into NextX
  108.     get line temp of field "Volume"
  109.     put it into y
  110.     if NextX > X then
  111.       put (line (temp-1) of field "DCV" + y) into line temp of field "DCV"
  112.     else
  113.       if NextX < X then
  114.         put (line (temp-1) of field "DCV"-y) into line temp of field "DCV"
  115.       else
  116.         if NextX=X then
  117.           put line(temp-1) of field "DCV" into line temp of field "DCV"
  118.         end if
  119.       end if
  120.     end if
  121.     put NextX into X
  122.   end repeat
  123.  
  124. end mouseUp
  125.  
  126.  
  127.  
  128. -- part 9 (button)
  129. -- low flags: 80
  130. -- high flags: 8003
  131. -- rect: left=92 top=320 right=342 bottom=192
  132. -- title width / last selected line: 0
  133. -- icon id / first selected line: 0 / 0
  134. -- text alignment: 1
  135. -- font id: 0
  136. -- text size: 12
  137. -- style flags: 0
  138. -- line height: 16
  139. -- part name: Print Graph
  140. ----- HyperTalk script -----
  141. on mouseUp
  142.   domenu "Print Card"
  143. end mouseUp
  144.  
  145.  
  146.  
  147. -- part 12 (button)
  148. -- low flags: 00
  149. -- high flags: 8003
  150. -- rect: left=398 top=300 right=320 bottom=480
  151. -- title width / last selected line: 0
  152. -- icon id / first selected line: 0 / 0
  153. -- text alignment: 1
  154. -- font id: 0
  155. -- text size: 12
  156. -- style flags: 0
  157. -- line height: 16
  158. -- part name: Chart
  159. ----- HyperTalk script -----
  160. on mouseUp
  161.   clearScreen
  162.   choose rect tool
  163.   set lineSize to 1
  164.   set filled to true
  165.   set pattern to 1
  166.   drag from 28,29 to 491,319
  167.  
  168.   --**get number of entries and entry width**--
  169.   put number of lines in field "DCV" into numEntries
  170.   put (430/numEntries) into entryWidth
  171.   put (430/numEntries)-10 into entryWidth1
  172.  
  173.   --**find scale for bars**--
  174.   put line 1 of field "DCV" into maxData
  175.   repeat with x = 2 to numEntries
  176.     put max(maxData, line x of field "DCV") into maxData
  177.   end repeat
  178.   set textFont to geneva
  179.   set textSize to 9
  180.   set textAlign to center
  181.   choose text tool
  182.   put 50 into x
  183.   put 1 into y
  184.   repeat for 5 times
  185.     click at 35, x
  186.     type (y*maxData)
  187.     put x + 60 into x
  188.     put y - .25 into y
  189.   end repeat
  190.   click at 35, 300
  191.   type "DCV Scale"
  192.  
  193.   --** plot chart for DCV **--
  194.   choose rect tool
  195.   set pattern to 13
  196.  
  197.   repeat with x = 0 to (numEntries-1)
  198.     put trunc (40 + (x * entrywidth)) into start
  199.     drag from start, trunc(290 - ((line (x+1) of field "DCV") / maxData) *240) to trunc(start + entryWidth1), 290
  200.   end repeat
  201.  
  202.   --** find scale for lines **--
  203.   put line 1 of field "Price" into maxData
  204.   repeat with x = 2 to numEntries
  205.     put max(maxData, line x of field "Price") into maxData
  206.   end repeat
  207.   choose text tool
  208.   put 50 into x
  209.   put 1 into y
  210.   repeat for 5 times
  211.     click at 480, x
  212.     type (y*maxData)
  213.     put x + 60 into x
  214.     put y - .25 into y
  215.   end repeat
  216.   click at 480, 300
  217.   type "Price Scale"
  218.   click at 255,305
  219.   type "Bar = DCV               Line = Price"
  220.  
  221.   --** plot chart for Price **--
  222.   set lineSize to 2
  223.   choose line tool
  224.   drag from 40, 290 to trunc(40+(1/2*entryWidth)), trunc(290-((line 1 of field "Price"/maxData)*240))
  225.   put trunc(40+(1/2*entryWidth)) into oldX
  226.   put trunc(290-((line 1 of field "Price"/maxData)*240)) into oldY
  227.   repeat with x = 2 to numEntries
  228.     put trunc(oldX+entryWidth) into newX
  229.     put trunc(290-((line x of field "Price"/maxData)*240)) into newY
  230.     drag from oldX, oldY to newX, newY
  231.     put newX into oldX
  232.     put newY into oldY
  233.   end repeat
  234.  
  235.   show bkgnd button "Print Graph"
  236.   show bkgnd button "Clear Graph"
  237.   choose browse tool
  238. end mouseUp
  239.  
  240. on clearScreen
  241.   choose select tool
  242.   drag from 29, 40 to 476, 302
  243.   domenu "Clear Picture"
  244. end clearScreen
  245.  
  246.  
  247.  
  248.  
  249. -- part 5 (field)
  250. -- low flags: 80
  251. -- high flags: 0007
  252. -- rect: left=396 top=96 right=322 bottom=468
  253. -- title width / last selected line: 0
  254. -- icon id / first selected line: 0 / 0
  255. -- text alignment: 0
  256. -- font id: 3
  257. -- text size: 12
  258. -- style flags: 0
  259. -- line height: 16
  260. -- part name: DCV
  261.  
  262.  
  263. -- part 13 (button)
  264. -- low flags: 80
  265. -- high flags: 8003
  266. -- rect: left=307 top=320 right=342 bottom=407
  267. -- title width / last selected line: 0
  268. -- icon id / first selected line: 0 / 0
  269. -- text alignment: 1
  270. -- font id: 0
  271. -- text size: 12
  272. -- style flags: 0
  273. -- line height: 16
  274. -- part name: Clear Graph
  275. ----- HyperTalk script -----
  276. on mouseUp
  277.   choose select tool
  278.   drag from 4,26 to 507,327
  279.   domenu "Clear Picture"
  280.   hide bkgnd button "Print Graph"
  281.   hide bkgnd button "Clear Graph"
  282.   choose browse tool
  283. end mouseUp
  284.  
  285.  
  286.